@extends('back.common.layout')
@section('title', '__TITLE__列表')

@section('content')
    <div id="content">
        <div class="page-header">
            <div class="container-fluid">
                <div class="pull-right">
                    <a href="{{route('__WEB__.set')}}" data-toggle="tooltip" title="新增" class="btn btn-primary">
                        <i class="fa fa-plus"></i>
                    </a>

                    <button type="button" data-toggle="tooltip" title="删除" class="btn btn-danger" onclick="confirm('确认？') ? $('#form-category').submit() : false;">
                        <i class="fa fa-trash-o"></i>
                    </button>
                </div>
                <h1>商品__TITLE__</h1>
                <ul class="breadcrumb">
                    <li>
                        <a href="{{url('admin/index')}}">首页</a>
                    </li>
                    <li>
                        <a href="{{route('__WEB__.list')}}">__TITLE__列表</a>
                    </li>
                </ul>
            </div>
        </div>
        <div class="container-fluid">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title">
                        <i class="fa fa-list"></i>
                        商品__TITLE__列表
                    </h3>
                </div>
                <div class="panel-body">
                    <form action="{{route('__WEB__.search')}}" method="post">
                        {{csrf_field()}}
                        <div class="well">
                            <div class="row">
                                <div class="col-sm-12">
                                    <div class="form-group">
                                        <label class="control-label" for="input-filter_title">__TITLE__名称</label>
                                        <input name="title" value="" placeholder="__TITLE__名称" id="input-filter_title" class="form-control" type="text">
                                        @if ($errors->has('title'))
                                            <label for="input-logo" class="text-danger">{{$errors->first('title')}}</label>
                                        @endif
                                    </div>
                                </div>
                            </div>
                            <div class="row"><!-- div.row>div.col-sm-12 -->
                                <div class="col-sm-12">
                                    <button type="submit" id="button-filter" class="btn btn-primary pull-right">
                                        <i class="fa fa-search"></i>
                                        筛选
                                    </button>
                                </div>
                            </div>
                        </div>
                    </form>
                    <form action="{{route('__WEB__.list')}}" method="post" enctype="multipart/form-data" id="form-category">
                        {{csrf_field()}}
                        <div class="table-responsive">
                            <table class="table table-bordered table-hover">
                                <thead>
                                    <tr>
                                        <td style="width: 1px;" class="text-center">
                                            <input type="checkbox" onclick="$('input[name*=\'selected\']').prop('checked', this.checked);" />
                                        </td>
                                        __THEAD__
                                        <td class="text-right">操作</td>
                                    </tr>
                                </thead>
                                <tbody>
                                @foreach ($__VIEW__Collection as $list)
                                    <tr>
                                        <td class="text-center">
                                            <input type="checkbox" name="selected[]" value="{{$list->id}}" />
                                        </td>
                                        __TBODY__
                                        <td class="text-right">
                                            <a href="{{route('__WEB__.set',['id' => $list->id])}}" data-toggle="tooltip" title="编辑" class="btn btn-primary">
                                                <i class="fa fa-pencil"></i>
                                            </a>
                                        </td>
                                    </tr>
                                @endforeach
                                </tbody>
                            </table>
                            @if ($errors->has('selected'))
                                <label for="input-logo" class="text-danger">{{$errors->first('selected')}}</label>
                            @endif
                        </div>
                    </form>

                    <div class="row" style="margin: 0 auto; display: inline-block">
                        {{$__VIEW__Collection->links()}}
                    </div>
                </div>
            </div>
        </div>
    </div>
@endsection